Skip to content

[BEAM-1251] print() is a function in Python 3#6166

Merged
charlesccychen merged 3 commits into
apache:masterfrom
cclauss:print_function
Aug 18, 2018
Merged

[BEAM-1251] print() is a function in Python 3#6166
charlesccychen merged 3 commits into
apache:masterfrom
cclauss:print_function

Conversation

@cclauss

@cclauss cclauss commented Aug 7, 2018

Copy link
Copy Markdown

print() is a function in Python 3 # just like #4784, #5531, and #5890

@charlesccychen @holdenk @superbobry

Please add a meaningful description for your change here


Follow this checklist to help us incorporate your contribution quickly and easily:

  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

It will help us expedite review of your Pull Request if you tag someone (e.g. @username) to look at it.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- --- --- --- ---
Java Build Status Build Status Build Status Build Status Build Status Build Status Build Status
Python Build Status --- Build Status
Build Status
--- --- --- ---

@superbobry

Copy link
Copy Markdown
Contributor

There seem to be two more occurences

sdks/python/apache_beam/io/tfrecordio_test.py
65:# ...   print data

sdks/python/apache_beam/utils/annotations.py
44:    print arg1, '*', arg2, '=',
55:    print arg1, '*', arg2, '(the old way)=',
63:    print arg1, '*', arg2, '(the experimental way)=',
69:  print multiply(5, 6)
70:  print old_multiply(5,6)
71:  print exp_multiply(5,6)

@cclauss

cclauss commented Aug 8, 2018

Copy link
Copy Markdown
Author

Thanks @superbobry, those instances were in comments, not in live code but I have converted them for completeness.

@superbobry superbobry left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cclauss

cclauss commented Aug 18, 2018

Copy link
Copy Markdown
Author

@charlesccychen @holdenk Your reviews please?

@cclauss

cclauss commented Aug 18, 2018

Copy link
Copy Markdown
Author

@pabloem Your review please?

@charlesccychen charlesccychen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This LGTM.

@charlesccychen charlesccychen merged commit 6637a50 into apache:master Aug 18, 2018
@cclauss cclauss deleted the print_function branch August 18, 2018 21:52
@cclauss

cclauss commented Aug 19, 2018

Copy link
Copy Markdown
Author

@holdenk This is merged now but I am wondering how the testing did not catch this and how we can prevent similar regression in the future. https://github.com/apache/beam/blob/master/sdks/python/scripts/run_mini_py3lint.sh#L51 should be able to spot these as syntax errors but perhaps it is only look at a portion of the codebase instead of looking at all Python files in the repo. On Travis, it takes 20 sec to do this flake8 test on the entire repo.

@tvalentyn

tvalentyn commented Aug 20, 2018

Copy link
Copy Markdown
Contributor

utils module is included py3 lint checks.

apache_beam/utils

I think the tools did not catch it because the occurrences are in the comment.

@cclauss

cclauss commented Aug 20, 2018

Copy link
Copy Markdown
Author

The first three files contained print statements in live code. These files are in .test-infra/jenkins which flake8 does not currently test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants